<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="https://unpkg.com/vue@next"></script>

<div id="app">
    <button v-on:click="clickEvent">按钮1</button>
    <button @click="clickEvent2">按钮2</button>
    <!-- 注意动态参数建议用全小写，浏览器会将该属性大写转成小写-->
    <button @[eventname]="clickEvent3()">按钮3</button>
</div>

<script>
    const vueOpt = {
        data(){
            return {
                eventname: 'click'
            }
        },

        methods:{
            clickEvent(){
                console.log('哈哈哈');
            },
            clickEvent2() {
                console.log('哈哈哈2');
            },
            clickEvent3(){
                console.log('哈哈哈3');
            }
        }
    }

    Vue.createApp(vueOpt).mount('#app')
</script>
</body>
</html>
